package com.zretc.notice.utils;

/**
 * 功能：
 * 作者：111
 * 日期：2024/7/3 16:24
 */
public class ContentAuditor {

    private SensitiveWordManager sensitiveWordManager;

    public ContentAuditor(SensitiveWordManager sensitiveWordManager) {
        this.sensitiveWordManager = sensitiveWordManager;
    }

    //自动审核
    public boolean containsSensitiveWords(String content) {
        for (String word : sensitiveWordManager.getSensitiveWords()) {
            if (content.toLowerCase().contains(word.toLowerCase())) {
                return false; // 发现敏感词
            }
        }
        return true; // 没有发现敏感词
    }
}